# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

require 'login_system'
require 'active_scaffold'

class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_songvoter_session_id'
  
  include LoginSystem
  # model :user

  def generate_menu
    case params[:controller]
      when 'users', 'roles', 'permissions'
      @menu = Menu.new('User Management')
      @menu.entries << ['users', url_for(:controller => 'users')]
      @menu.entries << ['roles', url_for(:controller => 'roles')]
      @menu.entries << ['permissions', url_for(:controller => 'permissions')]

    end
  end
end
